<%-- 
    Document   : index
    Created on : Aug 15, 2014, 3:55:50 PM
    Author     : 1Stmax
--%>

<%@page import="java.util.Vector"%>
<%@page import="javax.enterprise.inject.spi.Bean"%>
<%@page import="Bean.buildingtype"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <form action="#">
            <input type="text" name="id"/>
            <input type="submit" name="submit" value="find"/>
        </form>
        <%
            if (session.getAttribute("build") != null) {
                session.removeAttribute("build");
            }
            if (request.getParameter("id") != null) {
                buildingtype b = new buildingtype();
                b = b.findBuildingtypeByID(new Integer(request.getParameter("id")));
                String table = "<table border=1>"
                        + "<tr>"
                        + "<th>ID</th>"
                        + "<th>Room Name</th>"
                        + "<th>Type Name</th>"
                        + "<th>Actions</th>"
                        + "</tr>";
                table += "<tr>"
                        + "<td>" + b.getBuildingtypeid() + "</td>"
                        + "<td>" + b.getBuildingroomname() + "</td>"
                        + "<td>" + b.getBuildingtypename() + "</td>"
                        + "<td><a href='add.jsp'/>Add</a>  <a href='edit.jsp'/>Edit</a>  <a href='delete.jsp'/>Delete</a></td>"
                        + "</tr>";
                table += "</table>";
                out.print(table);
                session.setAttribute("build", b);
            }
        %>
    </body>
</html>
